<%@ page import="java.util.Date" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2025-11-10
  Time: 15:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>JSP基础语法</title>
</head>
<body>
    <%-- 输出当前时间
    JSP表达式格式：<%= 表达式/变量 %>
    --%>
    <%= new Date() %>

    <%
        int i = 10;
        for (; i < 100; i++) {

    %>
    <h4>JSP脚本片段</h4>
    <%
            System.out.println(i);
        }
        System.out.println(i);
        int j = 10;
        for (; j < 100; j++) {
            System.out.println(j);
        }
    %>

    <!-- HTML注释风格 -->
    <%!
        // 声明全局变量
        int k = 10;

        public void test() {
            System.out.println("test方法执行了...");
        }

    %>
</body>
</html>
